package com.kaishengit.pojo;


import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

@Entity
@Table(name="t_filetype")
@Cache(usage=CacheConcurrencyStrategy.READ_WRITE)
public class Filetype {
	private int id;
	private String name;
	private String filetypedesc;
	private String createtime;
	private String size;
	private User user;
	private Project project;
	private List<Files> filelist;
	private float sumsize;
	private int countnum;
	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getFiletypedesc() {
		return filetypedesc;
	}
	public void setFiletypedesc(String filetypedesc) {
		this.filetypedesc = filetypedesc;
	}
	public String getCreatetime() {
		return createtime;
	}
	public void setCreatetime(String createtime) {
		this.createtime = createtime;
	}
	@ManyToOne
	@JoinColumn(name="userid")
	public User getUser() {
		return user;
	}
	public void setUser(User user) {
		this.user = user;
	}
	@ManyToOne
	@JoinColumn(name="projectid")
	public Project getProject() {
		return project;
	}
	public void setProject(Project project) {
		this.project = project;
	}
	@OneToMany(mappedBy="filetype",cascade={CascadeType.REMOVE})
	public List<Files> getFilelist() {
		return filelist;
	}
	public void setFilelist(List<Files> filelist) {
		this.filelist = filelist;
	}
	@Transient
	public String getSize() {
		return size;
	}
	public void setSize(String size) {
		this.size = size;
	}
	@Transient
	public float getSumsize() {
		return sumsize;
	}
	public void setSumsize(float sumsize) {
		this.sumsize = sumsize;
	}
	@Transient
	public int getCountnum() {
		return countnum;
	}
	public void setCountnum(int countnum) {
		this.countnum = countnum;
	}
	
}
